package com.taoyun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.taoyun.pojo.entity.U_send_F;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface USendFMapper extends BaseMapper<U_send_F> {

    //根据用户userId查询对应u_send_f表的fileId
    @Select("select File_Id from U_send_F where User_Id = #{userId}")
    List<Integer> selectFileIdsByUId(@Param("userId") Integer userId);

    @Delete("delete from U_send_F where User_Id = #{userId}")
    Integer deleteByUId(@Param("userId") Integer userId);

    //根据文件id进行批量删除（XML配置）
    Integer DeleteBatchsByFileId(@Param("fileIds") List<Integer> fileIds);
}
